Request "'QMASTER REGISTRY'" '"\nWelcome to QMaster registration!\n\nPlease read the docs (Read Guide) for info on prices.\n\n\nHow would you like to registrate ?\n"' "'THOR|YAM|TEXTFILE|Read Guide|Cancel'"
EmailSystem=result;if EmailSystem=4 then call ShowGuide
end
if EmailSystem=0 then exit
Request "'QMASTER REGISTRY'" '"\nHow do you want to pay ?\n"' "'CASH|MONEY ORDER|INT. CHEQUE|Cancel'"
PayMethode=result
If PayMethode=0 then exit
GetString "'QMASTER REGISTRY'" '"\nPlease enter your (real) name:\n"'
MyName=result
if MyName="" then exit
GetString "'QMASTER REGISTRY'" '"\nPlease enter your address, state and country:\n\nSeperate with commas, f.ex:\n\nSkinstadgaarden,3370 Vikersund,NORWAY"'
State=result
if state="" then exit
if EmailSystem=1 then methode=" an event in Thor "
if EmailSystem=2 then methode=" an event in YAM "
if EmailSystem=3 then methode=" a text file "
count=0
call sepadd
Info=MyName||lf
do i=1 to count
Info=Info||address.i||lf;end
if PayMethode=1 then pm="cash"
if PayMethode=2 then pm="money order"
if PayMethode=3 then pm="international cheque"
Request "'QMASTER REGISTRY'" '"\nThank you!\n\nI will now try to create'methode'containing\nthe info you provided - I have the following info:\n\n'Info'\nPayment: 'pm'\n"' "OK|Cancel"
if result=0 then exit
if EmailSystem=1 then call MakeThor
if EmailSystem=2 then call MakeYAM
if EmailSystem=3 then call MakeText
address "QMASTER"
if result=0 then Request "'QMASTER REGISTRY'" '"\nI am done!\n\nYou may send the event/text to author\nand it will processed as soon as possible!\n\nThank you for supporting development!\n"' "OK"
else Request "'QMASTER REGISTRY'" '"\nERROR !\n\nSomething went wrong during event creation!\n"' "OK"
exit 0
error: say QMASTER.LASTERROR" ("SIGL")"
exit
sepadd: sep=-1
do while(sep~=0)
sep=pos(",",state)
if sep=0 then leave
count=count+1
address.count=left(state,sep-1)
state=right(state,length(state)-sep)
end
count=count+1
address.count=state
return 0
/* subs to create events */
MakeThor:
if ~show('p', 'BBSREAD') then do
address command
"run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
"WaitForPort BBSREAD"
end
if ~show('p', 'BBSREAD') then return 5
address "QMASTER"
GetString "'QMaster registry for Thor'" "'\nWhat is the name of your\nEmail SYSTEM in THOR ?\n'"
bbs = result
GetString "'QMaster registry for Thor'" "'\nWhat is the name of your\nEmail CONFERENCE in `"bbs"` ?\n'"
conf = result
address BBSREAD
UNIQUEMSGFILE bbsname '"'bbs'"' stem UFILE
if(rc~=0) then return 5
if(~open(fh,UFILE.NAME,w)) then return 5
call writeln(fh,lf"QMASTER REGISTRATION"lf)
call writeln(fh,info||lf)
call writeln(fh,"Pay methode: "pm)
call close(fh)
EVENT.SUBJECT = 'QMASTER AUTO REGISTRATION'
EVENT.TONAME = 'Kenny Nilsen'
EVENT.TOADDR = 'kenny@bgnett.no'
EVENT.CONFERENCE = conf
EVENT.MSGFILE = UFILE.NAME
WRITEBREVENT bbsname '"'bbs'"' event 0 stem EVENT
if(rc~=0) then goto quit
return 0
MakeYam:
if ~show('P','YAM') then do
address command 'run >nil: yam:yam nocheck'
address command 'sys:rexxc/WaitForPort YAM'
end
if ~show('P','YAM') then return 5
file="yam:outgoing/QMASTER.reg"
if ~open(fh,file,w) then return 5
call writeln(fh,lf"QMASTER REGISTRATION"lf)
call writeln(fh,info||lf)
call writeln(fh,"Pay methode: "pm||lf)
call close(fh)
address YAM
MailWrite
WriteMailTo '"kenny@bgnett.no (Kenny Nilsen)"'
WriteSubject '"QMASTER AUTO REGISTRATION"'
WriteLetter '"'file'"'
WriteQueue
exit
return 0
MakeText:
GetFile "'QMASTER - Save registry text as:'" "ram:" "QMASTER.reg"
file=result
if file="" then return 0
if ~open(fh,file,w) then return 5
call writeln(fh,lf"QMASTER REGISTRATION"lf)
call writeln(fh,info||lf)
call writeln(fh,"Pay methode: "pm||lf)
call writeln(fh,"Send text file to:"lf)
call writeln(fh,"Kenneth Chr. Nilsen"lf"Skinstadgaarden"lf"3370 Vikersund"lf"NORWAY"lf)